<!-- 中软验工计价查看页面 -->
<template>
    <t-collapse title="验工计价信息">
        <iframe :src="iframeUrl" scrolling="no" width="100%" :height="iframeHeight" frameborder="0" />
    </t-collapse>
</template>
<script>

export default {
    name: 'ZrPmsCheckInspection',
    props: {
        activityDefID: {
            type: String,
            default: ''
        },
        prjId: {
            type: String,
            default: ''
        }
    },
    data() {
        return {
            iframeHeight: ""
        }
    },
    computed: {
        iframeUrl() {
            return `${process.env.VUE_APP_ZHONGRUAN_URL}detailsOfInspection?prjId=${this.prjId}&subType=${this.$route.query.type === 'todo' ? 1 : ''}&workItemId=${this.$route.query.workItemId?this.$route.query.workItemId:''}&activityDefID=${this.activityDefID}`
        }
    },
    created() {
        window.addEventListener('message', (event) => {
            const base_url = ''
            if (event.origin === base_url) {
                return
            }
            // 获取验工计价高度
            if (event.data.type === 'detailsOfInspection') {
                this.iframeHeight = event.data.height
            }
        })
    }
}
</script>

<style scoped lang='scss'></style>
